﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Data.Tables
{
    [Table("Holiday")]
    public class Holiday : HolidayFields
    { }

    public class HolidayQuery : HolidayFields
    {
        [Display(Name = "Holiday Type")]
        public string HolidayTypeName { get; set; }

        [Display(Name = "Date")]
        public DateTime? Date { get; set; }
    }

    public class HolidayFields
    {
        [Key]
        [Display(Name = "ID")]
        public int ID { get; set; }

        [Required]
        [Display(Name = "Year")]
        public int Year { get; set; }

        [Required]
        [Range(1, 12, ErrorMessage="Select a month")]
        [Display(Name = "Month")]
        public int Month { get; set; }

        [Required]
        [Range(1, 31, ErrorMessage = "Select a day")]
        [Display(Name = "Day")]
        public int Day { get; set; }

        [Required]
        [Display(Name = "Description")]
        public string Description { get; set; }
        
        [Required]
        [Display(Name = "Holiday Type")]
        [Range(1, int.MaxValue, ErrorMessage = "Select a holiday type")]
        public int HolidayTypeID { get; set; }

        [Display(Name = "Recurring Holiday")]
        public int? RecurringHolidayID { get; set; }
    }

}